export default {
  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'nuxt1',
    htmlAttrs: {
      lang: 'ch'
    },
    meta: [
      { charset: 'utf-8' },
      {
        name: 'viewport',
        content: 'width=device-width, initial-scale=1, user-scalable=no'
      }
    ],
    link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: ['element-ui/lib/theme-chalk/index.css', '~/assets/css/global.scss'],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: ['@/plugins/element-ui', '@/plugins/axios.js'],
  router: {
    middleware: ['auth'],
    extendRoutes(routes, resolve) {
      routes.splice(0)
      routes.push(
        {
          name: 'home',
          path: '/',
          component: resolve('pages/index.vue')
        },
        {
          name: 'detail',
          path: '/detail.html',
          component: resolve('pages/detail/index.vue')
        },
        {
          name: 'list',
          path: '/list/list.html',
          component: resolve('pages/list/index.vue')
        }
      )
    }
  },
  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,
  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/eslint
    '@nuxtjs/eslint-module'
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: ['@nuxtjs/axios', 'cookie-universal-nuxt'],

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
    extractCSS: true,
    transpile: [/^element-ui/]
  }
}
